let PolygonBorderPrimitive = (function () {
  function _(positions, layer, options) {
    this.layer = layer;
    this.options = {
      name: '直线',
      polyline: {
        show: true,
        positions: [],
        material: Cesium.Color.fromCssColorString(options.outlineColor || "#ffffff"),
        width: options.outlineWidth || 1,
        clampToGround: true,
        zIndex: options.zIndex || 0
      }
    };
    this.positions = positions;
    this._init();
  }

  _.prototype._init = function () {
    let _self = this;
    let _update = function () {
      return [..._self.positions, _self.positions[0]];
    };
    //实时更新polyline.positions
    this.options.polyline.positions = new Cesium.CallbackProperty(_update, false);
    this.layer.entities.add(this.options);
  };

  return _;
})();
export default PolygonBorderPrimitive;